import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'//.vue可省略
import LayoutTest from '@/components/LayoutTest'
import BasicComponent from '@/components/BasicComponent'
import CalDemo from '@/components/CalDemo'
import DepartmentCrud from '@/components/DepartmentCrud'
import DemoPage from '@/components/DemoPage'

Vue.use(Router)

//下面的配置，就是在做： url地址与界面（资源）进行映射的配置
export default new Router({
  routes: [
    {
      path: '/', //访问路径 /开头，根URL，默认URL
      name: 'HelloWorld', //路由的名称
      component: HelloWorld //组件名称 ，来自于 import HelloWorld from '@/components/HelloWorld'
    },
    {
      path: '/layouttest', //访问路径 /开头，根URL，默认URL
      name: 'LayoutTest', //路由的名称
      component: LayoutTest //组件名称 ，来自于 import HelloWorld from '@/components/HelloWorld'
    },
    {
      path: '/basiccomponent', //访问路径 /开头，根URL，默认URL
      name: 'BasicComponent', //路由的名称
      component: BasicComponent //组件名称 ，来自于 import HelloWorld from '@/components/HelloWorld'
    }
    ,
    {
      path: '/caldemo', //访问路径 /开头，根URL，默认URL
      name: 'CalDemo', //路由的名称
      component: CalDemo //组件名称 ，来自于 import HelloWorld from '@/components/HelloWorld'
    },
    {
      path: '/departmentcrud', //访问路径 /开头，根URL，默认URL
      name: 'DepartmentCrud', //路由的名称
      component: DepartmentCrud //组件名称 ，来自于 import HelloWorld from '@/components/HelloWorld'
    },
    {
      path: '/demopage', //访问路径 /开头，根URL，默认URL
      name: 'DemoPage', //路由的名称
      component: DemoPage //组件名称 ，来自于 import HelloWorld from '@/components/HelloWorld'
    }
  ]
})
